class Solution(object):
    def finalValueAfterOperations(self, operations):
        d = {'X++':1, '++X':1, '--X':-1,'X--':-1}
        x = 0
        for c in operations:
            x += d[c]
        return x